from tools.db import *
from tools.getbar import *
from tools.getxls import *

### 出库
db = PutinDB('S20040941')
barcode = Barcode()
n = input('输入任意键继续，输入Q退出：')
while n != 'Q':
    my_barcode = barcode.str_to_json()
    bar_dic = json.loads(my_barcode)
    db.putin_goods_id = bar_dic['pc']
    db.hanjie('P20041021')
    n = input('输入任意键继续，输入Q退出：')
del db


### 入库
# lc = Lcexcil('tools/lc.xlsx')
# lc.get_values()
# db = PutinDB('S20040941')
# db.putin_on = lc.putin_on
# db.putin_fee = lc.putin_fee
# for i in range(0, lc.rows):
#     db.stock = 0
#     db.goods_name = lc.goods_name[i]
#     db.putin_goods_id = lc.market_id[i]
#     db.putin_type = lc.brand_num[i]
#     db.putin_num = lc.goods_num[i]
#     db.goods_money = lc.goods_money[i]
#     db.order = '{:0>2}'.format(lc.order[i])
#     db.brand = lc.brand[i]
#     db.goods_type = lc.type[i]
#     # print(db.order)
#     db.update_stock()
# del db
